package ee.falcon.xml;

import java.util.Iterator;

import javax.xml.XMLConstants;
import javax.xml.namespace.NamespaceContext;
import ee.falcon.GeneralConst;

public class FalconNamespaceContext implements NamespaceContext 
{
 
  /**
   * A method to return the Namespace URI of a given
   * namespance prefix
   *
   * @param prefix the prefix to math
   *
   * @return       the matched namespace URI
   */
  public String getNamespaceURI(String prefix) 
  {
    // determine which namespace to return
    if (prefix == null) 
    {
      // no prefix specified
      throw new NullPointerException("Null prefix");
    } 
    else if ((GeneralConst.NAMESPACE_PREFIX_FOR_FALCON_FTP).equals(prefix)) 
    {
      // fal s.t. falcon namespace
      return GeneralConst.FALCON_NAMESPACE_URI;
    }  
    else 
    {
      // default namespace
      return XMLConstants.XML_NS_URI;
    }
  }

  /**
   * This method is not necessary for XPath
   */
@Override
public String getPrefix(String arg0) 
{
	// TODO Auto-generated method stub
	return null;
}
/**
 * This method is not necessary for XPath
 */
@SuppressWarnings("unchecked")
@Override
public Iterator getPrefixes(String arg0) 
{
	// TODO Auto-generated method stub
	return null;
}

 
}

